import { Pagination } from 'antd';
import { getMessage } from '@inbiz/react';
import './index.less';

export default function Paginations(props: any) {
  const { pageData, queryList } = props;
  return (
    <div className="pagenation">
      <Pagination
        showQuickJumper
        showSizeChanger
        defaultPageSize={10}
        total={pageData.total}
        current={pageData.pageIndex}
        pageSize={pageData.pageSize}
        pageSizeOptions={['10', '20', '30', '50']}
        onChange={(page, pageSize) => queryList(page, pageSize)}
        showTotal={(total) => `${getMessage('processCenter.total')} ${total} ${getMessage('processCenter.items')}`}
        onShowSizeChange={(page, pageSize) => queryList(page, pageSize)}
      />
    </div>
  );
}
